package com.novice.controller;

import com.novice.domain.entity.User;
import com.novice.service.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private IUserService iUserService;

    @GetMapping("/{userId}")
    public User getUserById(@PathVariable("userId") Long userId) {
        return iUserService.getById(userId);
    }
}
